package org.dromara.iot.enums;

import lombok.Getter;

@Getter
public enum ElevatorEventTypeEnum {
    /**
     * 烟雾告警事件
     */
    SMOKE_ALARM_EVENT(1, "SMOKE_ALARM_EVENT", "烟雾检测告警"),
    /**
     * 火焰告警事件
     */
    FIRE_ALARM_EVENT(2, "FIRE_ALARM_EVENT", "火灾检测告警"),
    /**
     * 禁止物品告警事件
     */
    FORBIDDEN_ITEM_ALARM_EVENT(3, "FORBIDDEN_ITEM_ALARM_EVENT", "禁止物品检测告警"),
    /**
     * 人员行为告警事件
     */
    BEHAVIOR_ALARM_EVENT(4, "PERSON_BEHAVIOR_ALARM_EVENT", "人员行为检测告警"),
    /**
     * 电梯上下线事件
     */
    ELEVATOR_ONLINE_EVENT(5, "ELEVATOR_ONLINE_EVENT", "电梯上下线");
    private final Integer code;
    private final String type;
    private final String desc;

    ElevatorEventTypeEnum(Integer code, String type, String desc) {
        this.code = code;
        this.type = type;
        this.desc = desc;
    }

    public static ElevatorEventTypeEnum getByType(String type) {
        for (ElevatorEventTypeEnum value : values()) {
            if (value.getType().equals(type)) {
                return value;
            }
        }
        return null;
    }
}